import pojo.DateActive;
import pojo.User;

import java.awt.print.Book;
import java.io.File;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

/**
 * @author gzkemays
 * @date 2020/12/7 16:47
 */
public class test {
    public final String PATH_FILE = "D:/tomcat-9.0.41/apache-tomcat-9.0.41/webapps/mnfstums4/WEB-INF";
    public String DIR = PATH_FILE.substring(0,PATH_FILE.indexOf("/WEB-INF"));
    public static final String HTTP = "http://ky.gzpykj.com/nfstums4";
    public test() throws IOException {
    }

    public static void main(String[] args) throws IOException {
        test t = new test();
        t.tests();
/*        long a = 1;
        long b = 2;
        double c = new BigDecimal((float)a/b).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
        System.out.println("c = " + c);

        User build = BuilderUtils.of(User::new).with(User::setId, 1).build();*/
    }
    
    public void tests() {
        String txt = "D:/tomcat-9.0.41/apache-tomcat-9.0.41/webapps/mnfstums4/uploadfiles/mp4/20210222/14444367/nfyk-19258515601445067526.ts";
        String path = txt.replace(DIR, HTTP).replace("\\", "/");
        System.out.println("txt.replaceAll(\"/\",\"\\\\\") = " + txt.replace("/","\\"));
/*        System.out.println("DIR = " + DIR);
        System.out.println("substring = " + path);*/
    }
    /**
     * 加密解密算法 执行一次加密，两次解密
     */
    public static String convertMD5(String inStr) {
        char[] a = inStr.toCharArray();
        for (int i = 0; i < a.length; i++) {
            a[i] = (char) (a[i] ^ 't');
        }
        String s = new String(a);
        return s;
    }
}
